feat(pkgs): add standalone asio 1.38.1#73
Conversation
Upstream's tag archives (tar.gz AND zip) both contain the POSIX symlinks asio/include -> ../include and asio/src -> ../src, so switching encodings could not fix the Windows extraction failure (tar.exe cannot materialize them; job exits 127 right after download). Upstream publishes no symlink-free asset for 1.38.x (no GitHub release assets; SourceForge stops at 1.36.0). Windows now uses a repackaged variant of the upstream tag tarball with only those two symlink entries removed (tar --delete + gzip -n -9; all 1544 regular files byte-identical, provenance in xlings-res/asio README), hosted at github.com/xlings-res/asio (GLOBAL) and gitcode.com/mcpp-res/asio (CN). Linux/macOS keep the canonical upstream tarball as GLOBAL and gain a byte-identical CN mirror on mcpp-res. All hosted assets sha256-verified after upload. Verified locally with pinned mcpp 0.0.94: descriptor lints + xpkg parse pass, and the asio member test passes cold (6/6).
CI failure analysis:
|
With the symlink-free archive in place, the Windows job progressed to runtime failures: core and network crashed with 0xC0000409 and coroutine exited 1 while the thread-free tests (experimental/platform/surface) passed. Reproduced under mingw+wine: asio's thread detection keys off CRT macros (_MT/_REENTRANT/_POSIX_THREADS) the toolchain does not define, so it silently selects null_thread and the steady_timer wait thread throws operation_not_supported (10045, 'thread: asio.system error'). Pin ASIO_HAS_THREADS in the default standalone feature. asio only tests defined(ASIO_HAS_THREADS) and POSIX pthread selection still runs beneath it, so this is a no-op where detection already works. All six consumer tests pass under mingw+wine with the pin (platform's pipe path is a wine limitation, passes on real Windows), and the Linux member suite passes 6/6 cold with the define present in every consumer TU's compile command.
Follow-up: second Windows root cause found and fixed — CI is now fully green ✅The symlink-free archive ( Root cause (reproduced exactly under mingw-w64 + wine): asio's thread detection keys off CRT macros ( Fix ( Verification:
Design doc §3 updated with the rationale. |
…separate compilation) (#80) * feat(compat.asio-m): adapt Asio 1.38.1 as C++23 module (separate compilation) Add [email protected] — a FORM B inline descriptor exposing standalone asio as 'import asio;' with ASIO_SEPARATE_COMPILATION mode. Changes: - pkgs/c/compat.asio-m.lua: Form B descriptor with generated module wrapper (37 asio headers included, ~55 using declarations exported: core/io, TCP/UDP networking, cancellation, experimental channel/use_promise, executor completeness, and common token adapters) - tests/examples/asio-module/: 5 tests (core, coroutine, experimental, network, surface) covering the full exported API surface - mcpp.toml: add tests/examples/asio-module to workspace members Tested: mcpp test -p asio-module => 5/5 passed Regression: mcpp test -p asio => 6/6 passed mcpp test -p spdlog, nlohmann.json, marzer.tomlplusplus => all OK Closes #73 (companion to compat.asio PR) * fix(compat.asio-m): export make_error_code(channel_errors) for GCC modules ADL On GCC (Linux CI), the make_error_code(channel_errors) function declared in asio/experimental/channel_error.hpp is in the global module fragment and NOT reachable from the importing TU via ADL. This causes: error: use of deleted function 'void std::__adl_only::make_error_code()' when the channel template destructor instantiates channel_traits::invoke_receive_cancelled() which constructs std::error_code from error::channel_cancelled. Fix: add an explicit exported using declaration: export namespace asio::experimental::error { using ::asio::experimental::error::make_error_code; } Clang (macOS) apparently tolerates the missing export, but GCC requires it. Also include channel_error.hpp explicitly in the global fragment. * refactor(compat.asio-m -> chriskohlhoff.asio): rename per upstream review Upstream requested package name change from compat.asio-m to chriskohlhoff.asio (namespace chriskohlhoff). Consumers can now use: mcpp add [email protected] (full qualified) mcpp add [email protected] (shorthand) This is purely a package-name and namespace rename; the C++ module surface (import asio;) is unchanged. Also update the test project's mcpp.toml to match the new index. * docs(chriskohlhoff.asio): warn against ambiguous shorthand mcpp add [email protected] The shorthand 'asio' matches multiple packages in the default registry (compat.asio, mcpplibs.asio), causing resolution conflict. Consumers must use the fully qualified name 'chriskohlhoff.asio' instead. mcpp add [email protected] (correct, unambiguous) mcpp add [email protected] (ambiguous, may fail or resolve wrongly) --------- Co-authored-by: wellwei <[email protected]>
Summary
[email protected]as a standalone header-only package-pthreadlink contractThis PR intentionally excludes the separate native
import asio;adapter and optional OpenSSL/wolfSSL, Boost.Context/Regex/Date_Time, and liburing integrations.README is unchanged.
Upstream verification
asio-1-38-1, latest numeric Asio tag checked on 2026-07-17BSL-1.0)2827b229972be80cdb14e5497962fa393d1adf036b5869e2b9c99f644daadacc*/include/asio.hppNo CN mirror is declared because no authorized byte-identical mirror asset is available; the descriptor uses the canonical upstream URL.
Local verification
Client:
mcpp 0.0.94; local descriptor lint: Lua 5.5.0.mcpp xpkg parse pkgs/c/compat.asio.luapassedmcpp add compat:[email protected]wrote[dependencies.compat] asio = "1.38.1"compat.asioASIO_STANDALONE,ASIO_HEADER_ONLY, andASIO_DISABLE_BOOST_CONTEXT_FIBERgit diff --check origin/main...HEADpassedorigin/mainThe active GitHub workflow will run its pinned Lua 5.4 lint and the Linux/macOS/Windows workspace matrix.